package com.spike.listener;

import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.context.annotation.Configuration;

@Configuration
public class SMSRabbitListener {
    @RabbitListener(queues = "SMSDirectQueue")
    public void getMsg(Message message){
        // 获取消息
        System.out.println("你监听到的消息是:"+new String(message.getBody()));

    }
}
